﻿package engine.base.sim {
	import flash.errors.IllegalOperationError;
	import flash.events.EventDispatcher;
	
	/**
	* Base object for almost everything in the game. Allows objects
	* to be globally registered and accessible.
	* @author Jon Smelquist
	*/
	public class SimObject extends EventDispatcher{
		
		protected var _name:String;
		
		/**
		 * This is the base class for all objects in the game that
		 * need to be tracked. Objects of this type can register and
		 * become locatable.
		 */
		public function SimObject() { }
		
		/**
		 * Register this object with the root set
		 * @param	name	Name key to store object under
		 */
		public function registerObject(name:String):void {
			_name = name;
			Sim.registerObject(this, _name);
		}
		
		public function get name():String {
			return _name;
		}

	}
	
}